package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.entity.Dish;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface DishMapper extends BaseMapper<Dish> {

    //select d.*,c.name categoryName
    //from dish d left join category c on d.category_id=c.id
    //where d.name like concat('%','肉','%')
    //order by d.update_time desc
    // 完成以上的sql语句可以依靠xml文件完成动态sql;
    IPage<DishDto> getPageByName(Page<DishDto> pageInfo, String name);
}